"""author:qinyu
   data: 2021/12/8
   project: cjh
"""

# 1.
# import re
#
# name1 = ['_q123456q_qd','1q123456q_qd']
# def func_name(name):
#     if re.findall(r"^[a-zA-Z_]\w{5,19}$", name):
#         return name + '符合'
#     else:
#         return name + '不符合'
# print(list(map(func_name, name1)))

# 2.
# import re
#
# name1 = ['_q123456q_qd','1q123456q_qd']
# def func_name(name):
#     return re.findall(r"^[a-zA-Z_]\w{5,19}$", name)
# print(list(filter(func_name, name1)))

# 3.
# from functools import reduce
# print(reduce(lambda x,y:x*y,range(1,11)))

# 4.
# print(list(filter(lambda x:x%3==0,range(1,101))))

# 5.
# print(list(map(lambda x:x**2,range(1,11))))


# 6.
# list1 = [7, -8, 5, 4, 0, -2, -5]
#
# print(sorted(i for i in list1 if i>0)+sorted(i for i in list1 if i<=0)[::-1])


# 7.
# s ='asdf234GDSdsf23'
# def f1(s):
#     for i in s:
#         if i.isdigit():
#             if int(i) % 2 == 0:
#                 return (True, True, i)
#             else:
#                 return (True, False, i)
#         elif i.isupper():
#             return (False, True, i)
#         else:
#             return (False, False, i)
#
# print(''.join(sorted(s, key=f1)))

# 8.
import string
import random

# with open('big.data','w+',encoding="utf-8")as f:
#     f.write('aaaaaaaaaaaaaaaaaa\n'*10**7)
#     f.write((" ".join(random.choices(string.ascii_lowercase,k=random.randint(1,50)))+"\n"))


# def read_file(fpath):
#     with open(fpath, 'rb') as f:
#         for i in f.readlines():
#
